#导入创建app的方法
from flask import request
from app import create_app
#导入装饰器方法
from conf.comm import sqlalchemy_context
from database import *
from views.users import bp_users

#获取app
app = create_app()
#注册蓝图
app.register_blueprint(bp_users,url_prefix='/users')

#创建表
@app.route('/add/')
@sqlalchemy_context()
def create_table():
    db.create_all()
    return 'ok'
from utils.redisconn import r
@app.route('/test')
def test():
    r.str_set('182','111',30)
    res = r.str_get('182')
    print(res)
    return 'ok'

if __name__ == "__main__":
    app.run()